<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="javax.jdo.PersistenceManager" %>
<%@page import="CRM.PMF" %>
<%@page import="CRM.Company" %>
<%@page import="java.util.List" %>

<%@include file= "header.jsp" %>

<table class="list">
    <tr>
	<th>No</th>
	<th>Ad</th>
	<th>Sahibi</th>
	<th>Telefon</th>
	<th>E-Posta</th>
	<th>&nbsp;</th>
    </tr>
    <%
    PersistenceManager pm = PMF.get().getPersistenceManager();
    String query = "SELECT FROM " + Company.class.getName() + " ";
    List<Company> companies = (List<Company>) pm.newQuery(query).execute();
    int i = 0;
    for( Company c : companies )
    {
	i++;
    %>
    <tr>
	<td><% out.print(i); %></td>
	<td><% out.print(c.getName()); %></td>
	<td><% out.print(c.getOwner()); %></td>
	<td><% out.print(c.getOfficePhone()); %></td>
	<td><% out.print(c.getEmail()); %></td>
	<td>
	    <a href="saveCompany.jsp">Düzenle</a>
	    <a href="showCompanyDetails.jsp">Detay</a>
	    <a href="addNoteToCompany.jsp">Not Ekle</a>
	    <a href="addTaskToCompany.jsp">Task Ekle</a>
	</td>
    </tr>
    <%
    }
    %>
</table>

<%@include file= "footer.jsp" %>